﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Base.Master" AutoEventWireup="true"
    CodeBehind="MenuAddAndEdit.aspx.cs" Inherits="QuickLifeHall.ERP.Pages.SystemBase.Menu.MenuAddAndEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(function () {
            //加载数据
            var param = getParam();
            switch (param.action) {
                case "new":
                    {
                        
                    }
                    break;
                case "edit":
                    {

                    }
                    break;
            }
            $("#UserID").val(user.UserID);
            $("#UserName").val(user.UserName);
        });

        function _valid() {
            return $('.easyui-validatebox').validatebox('isValid');
        }

        function _save() {
            if (_valid()) {
                var user = {};
                user.UserName = $("#UserName").val();
                user.UserPassword = $("#Password").val();
                user.State = $("#State").val();
                QuickLifeHall.Facade.SystemBase.User.AddUser(JSON.stringify(user), function (result) {
                    if (result != null && result.value) {
                        alert(result.value.message);
                    }
                    else {
                        alert(result.error.Message)
                    }
                });
            }
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-save" plain="true"
            onclick="_save()">保存</a>
    </div>
    <div class="row" id="errorMessage">
    </div>
    <div class="row">
        <span class="title">上级菜单：</span>
        <input type="text" id="parentMenuName" value="" class="easyui-textbox  easyui-validatebox"
            required="true" style="width: 150px;" />
        <input type="hidden" id="parentMenuID" value="" />
    </div>
    <div class="row">
        <span class="title">菜单名称：</span>
        <input type="text" id="menuName" value="" style="width: 150px;" class="easyui-textbox  easyui-validatebox"
            required="true" />
    </div>
    <div class="row">
        <span class="title">链接地址：</span>
        <input type="text" id="url" value="" style="width: 150px;" class="easyui-textbox" />
    </div>
    <div class="row">
        <span class="title">菜单图标：</span>
        <input type="text" id="icon" value="" style="width: 150px;" class="easyui-textbox" />
    </div>
    <div class="row">
        <span class="title">状态：</span>
        <select id="State" style="width: 150px;">
            <option value="1">启用</option>
            <option value="0">停用</option>
        </select>
    </div>
</asp:Content>
